package cn.edu.nju.askme.model;
// default package

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


/**
 * Option entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="option"
    ,catalog="askme"
)

public class Option  implements java.io.Serializable {


    // Fields    

     private Integer id;
     private Question question;
     private String label;
     private String content;


    // Constructors

    /** default constructor */
    public Option() {
    }

    
    /** full constructor */
    public Option(Question question, String label, String content) {
        this.question = question;
        this.label = label;
        this.content = content;
    }

   
    // Property accessors
    @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id", unique=true, nullable=false)

    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
	@ManyToOne(fetch=FetchType.EAGER)
        @JoinColumn(name="qid", nullable=false)

    public Question getQuestion() {
        return this.question;
    }
    
    public void setQuestion(Question question) {
        this.question = question;
    }

    @Column(name="label", nullable=false, length=45)
    public String getLabel() {
    	return label;
    }
    
    public void setLabel(String label) {
        this.label = label;
    }
    
    @Column(name="content", nullable=false, length=65535)

    public String getContent() {
        return this.content;
    }
    
    public void setContent(String content) {
        this.content = content;
    }
   








}